from appium.webdriver.common.mobileby import MobileBy
from selenium.webdriver.common.by import By

from demo.xueqiuAppium.page.base_page import BasePage
from demo.xueqiuAppium.page.profile_page import Profile
from demo.xueqiuAppium.page.search_page import Search


class Main(BasePage):
	# _driver: WebDriver
	#
	# def __init__(self, driver):
	# 	self._driver = driver

	def goto_search_page(self):
		self.find(MobileBy.ID, 'tv_search').click()
		return Search(self._driver)

	def goto_profile_page(self):
		self.find((By.XPATH, '//*[contains(@resource-id, "tab") and @text="我的"]')).click()
		return Profile(self._driver)

